<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<form:form commandName="model" cssClass="validate"
	action="incident/category/save">
	<form:hidden path="id" />
	<table class=" form-table">
		<tbody>
			<tr>
				<td class="td1">父级：</td>
				<td class="td2"><form:input path="parentId" cssClass="hidden" />
					<isperp:treeSelector id="selectParentincidentCategory"
						url="incident/category/getTree" valueControlId="parentId"
						displayValue="${parentName}" displayValueCssClass="required"></isperp:treeSelector>
				</td>
			</tr>

			<tr>
				<td class="td1">名称：</td>
				<td class="td2"><form:input path="name" cssClass="required" />
				</td>
			</tr>
			
			<tr>
				<td class="td1">是否自动分派（需要配置关联工程师）：</td>
				<td class="td2"><form:checkbox path="areauto" /></td>
			</tr>

			<tr>
				<td class="td1">是否展开：</td>
				<td class="td2"><form:checkbox path="open" /></td>
			</tr>
			<tr>
				<td class="td1">排序：</td>
				<td class="td2"><form:input path="orderNum" cssClass="number" />
				</td>
			</tr>
		</tbody>
	</table>

</form:form>

<div class="box tabbedBox">
	<div class="header">
		<ul>
			<li><a class="current" href="#categoryIdRelateMemberDiv">关联人员</a>
			</li>
		</ul>
		<h2>&nbsp;</h2>
	</div>
	<div style="padding:0" class="content tabbed">

		<div id="categoryIdRelateMemberDiv">
			<isperp:grid url="incident/category/categoryRelateMemberUserList"
				postData="categoryId:function() { return $('#id').val()}"
				showPager="false" showSearchbar="false" gridId="projectMemberGrid"
				height="auto" gridTitle="title"
				cusFormatterActions="true" cusDeleteUrl="incident/categoryRelamembers/delete">
				
				<jsp:attribute name="toolbar">
				<isperp:toolbar id="projectMemberGridToolbar">
					<isperp:button id="projectMemberGridCreate" icon="icon-plus"
							text="关联工程师" onclick="addMember();"></isperp:button>
				</isperp:toolbar>
				</jsp:attribute>
				<jsp:body> 
				<isperp:column name="id" title="id" hidden="true"></isperp:column>
				<isperp:column name="fullname" title="姓名" width="80">
				</isperp:column>
				<isperp:column name="position_name" title="职位" width="100">
				</isperp:column>
				<isperp:column name="mobile" title="电话" width="90">
				</isperp:column>
				<isperp:column name="longitude" title="longitude" hidden="true">
				</isperp:column>
				<isperp:column name="latitude" title="latitude" hidden="true">
				</isperp:column>
				<isperp:column name="name" title="name" hidden="true">
				</isperp:column>
				<isperp:column name="department_id" title="department_id"
					hidden="true">
				</isperp:column>
				<isperp:column name="department_treenode_name_path"
					title="department_treenode_name_path" hidden="true">
				</isperp:column>
				
				</jsp:body>
			</isperp:grid>
		</div>
	</div>
</div>

<isperp:buttonList>
	<button class="submit" onclick="isperp.submitForm(); return false;">
		<span class="icon icon-save"></span>提交
	</button>
</isperp:buttonList>
<script type="text/javascript">
	function addMember() {
		var roleId = $("#id").val();
		isperp.openDialog({
			onThisWindow : false,
			windowSize : "normal",
			contentUrl : "incident/category/relateEgEdit?roleId=" + roleId
					+ "&pcontrolid=projectMemberGrid"
		});
	}
</script>
